
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>5.2 伪分布运行模式 · 大数据hadoop课堂笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content=" 李振超">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-change_girls/girls.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="53-wan-quan-fen-bu-yun-xing-mo-shi.html" />
    
    
    <link rel="prev" href="51-ben-di-yun-xing-mo-shi.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.atguigu.com/" target="_blank" class="custom-link">联系我们</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        <li class="header">第 1 部分 Hadoop入门</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    本书介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1.html">
            
                <a href="../chapter1.html">
            
                    
                    第 1 章 大数据概论
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../chapter1/11da-shu-ju-gai-nian.html">
            
                <a href="../chapter1/11da-shu-ju-gai-nian.html">
            
                    
                    1.1大数据概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../chapter1/12-da-shu-ju-ying-yong-chang-jing.html">
            
                <a href="../chapter1/12-da-shu-ju-ying-yong-chang-jing.html">
            
                    
                    1.2 大数据应用场景
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../chapter1/13-da-shu-ju-de-fa-zhan-qian-jing.html">
            
                <a href="../chapter1/13-da-shu-ju-de-fa-zhan-qian-jing.html">
            
                    
                    1.3 大数据的发展前景
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../chapter1/14-da-shu-ju-de-te-dian.html">
            
                <a href="../chapter1/14-da-shu-ju-de-te-dian.html">
            
                    
                    1.4 大数据的特点
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../di-2-zhang-hadoop-gai-shu.html">
            
                <a href="../di-2-zhang-hadoop-gai-shu.html">
            
                    
                    第 2 章 Hadoop 概述
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../di-2-zhang-hadoop-gai-shu/21-hadoopshi-shi-yao.html">
            
                <a href="../di-2-zhang-hadoop-gai-shu/21-hadoopshi-shi-yao.html">
            
                    
                    2.1 Hadoop是什么
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../di-2-zhang-hadoop-gai-shu/22-hadoopfa-zhan-li-shi.html">
            
                <a href="../di-2-zhang-hadoop-gai-shu/22-hadoopfa-zhan-li-shi.html">
            
                    
                    2.2 Hadoop发展简史
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../di-2-zhang-hadoop-gai-shu/23-hadoopde-san-da-fa-xing-ban-ben.html">
            
                <a href="../di-2-zhang-hadoop-gai-shu/23-hadoopde-san-da-fa-xing-ban-ben.html">
            
                    
                    2.3 Hadoop的发行版本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../di-2-zhang-hadoop-gai-shu/24-hadoopde-you-shi.html">
            
                <a href="../di-2-zhang-hadoop-gai-shu/24-hadoopde-you-shi.html">
            
                    
                    2.4 Hadoop的优势
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai.html">
            
                <a href="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai.html">
            
                    
                    第 3 章 Hadoop的组成模块
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai/31-hadoop1xde-zu-cheng.html">
            
                <a href="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai/31-hadoop1xde-zu-cheng.html">
            
                    
                    3.1 Hadoop1.x的组成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai/32-hadoop2xde-zu-cheng.html">
            
                <a href="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai/32-hadoop2xde-zu-cheng.html">
            
                    
                    3.2 Hadoop2.x的组成
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.2.1" data-path="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai/32-hadoop2xde-zu-cheng/321-hdfsjia-gou-gai-shu.html">
            
                <a href="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai/32-hadoop2xde-zu-cheng/321-hdfsjia-gou-gai-shu.html">
            
                    
                    3.2.1 HDFS架构概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2.2" data-path="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai/32-hadoop2xde-zu-cheng/322-yarn-jia-gou-gai-shu.html">
            
                <a href="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai/32-hadoop2xde-zu-cheng/322-yarn-jia-gou-gai-shu.html">
            
                    
                    3.2.2 YARN 架构概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2.3" data-path="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai/32-hadoop2xde-zu-cheng/323-mapreducejia-gou-gai-shu.html">
            
                <a href="../di-3-zhang-hadoop-de-zu-cheng-mo-kuai/32-hadoop2xde-zu-cheng/323-mapreducejia-gou-gai-shu.html">
            
                    
                    3.2.3 MapReduce架构概述
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../di-3-zhang-hadoop-kai-fa-huan-jing-da-jian.html">
            
                <a href="../di-3-zhang-hadoop-kai-fa-huan-jing-da-jian.html">
            
                    
                    第 4 章 Hadoop 运行环境搭建
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../di-3-zhang-hadoop-kai-fa-huan-jing-da-jian/41-zhun-bei-xu-ni-ji-huan-jing.html">
            
                <a href="../di-3-zhang-hadoop-kai-fa-huan-jing-da-jian/41-zhun-bei-xu-ni-ji-huan-jing.html">
            
                    
                    4.1 准备虚拟机环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../di-3-zhang-hadoop-kai-fa-huan-jing-da-jian/42-an-zhuang-jdk.html">
            
                <a href="../di-3-zhang-hadoop-kai-fa-huan-jing-da-jian/42-an-zhuang-jdk.html">
            
                    
                    4.2 安装jdk
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../di-3-zhang-hadoop-kai-fa-huan-jing-da-jian/43-an-zhuang-hadoop.html">
            
                <a href="../di-3-zhang-hadoop-kai-fa-huan-jing-da-jian/43-an-zhuang-hadoop.html">
            
                    
                    4.3 安装 Hadoop
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../di-4-zhang-yun-xing-hadoop.html">
            
                <a href="../di-4-zhang-yun-xing-hadoop.html">
            
                    
                    第 5 章 运行 Hadoop
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="51-ben-di-yun-xing-mo-shi.html">
            
                <a href="51-ben-di-yun-xing-mo-shi.html">
            
                    
                    5.1 本地运行模式
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.6.2" data-path="52-wei-fen-bu-yun-xing-mo-shi.html">
            
                <a href="52-wei-fen-bu-yun-xing-mo-shi.html">
            
                    
                    5.2 伪分布运行模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="53-wan-quan-fen-bu-yun-xing-mo-shi.html">
            
                <a href="53-wan-quan-fen-bu-yun-xing-mo-shi.html">
            
                    
                    5.3 完全分布运行模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">第 2 部分 HDFS</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../di-2-bu-fen-hdfs/di-6-zhang-hdfs-gai-shu.html">
            
                <a href="../di-2-bu-fen-hdfs/di-6-zhang-hdfs-gai-shu.html">
            
                    
                    第 6 章 HDFS概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="../di-2-bu-fen-hdfs/di-7-zhang-hdfs-de-shell-cao-zuo.html">
            
                <a href="../di-2-bu-fen-hdfs/di-7-zhang-hdfs-de-shell-cao-zuo.html">
            
                    
                    第 7 章 HDFS的shell操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo.html">
            
                <a href="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo.html">
            
                    
                    第 8 章 HDFS客户端操作
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/81-ke-hu-duan-huan-jing-zhun-bei.html">
            
                <a href="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/81-ke-hu-duan-huan-jing-zhun-bei.html">
            
                    
                    8.1 客户端环境准备
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.2" data-path="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/82-shi-yong-java-cheng-xu-lai-fang-wen-hdfs.html">
            
                <a href="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/82-shi-yong-java-cheng-xu-lai-fang-wen-hdfs.html">
            
                    
                    8.2 使用Java程序来访问HDFS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.3" data-path="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/83-zai-hdfs-zhong-chuang-jian-mu-lu.html">
            
                <a href="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/83-zai-hdfs-zhong-chuang-jian-mu-lu.html">
            
                    
                    8.3 在HDFS中创建目录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.4" data-path="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/84-hdfschang-yong-api-cao-zuo.html">
            
                <a href="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/84-hdfschang-yong-api-cao-zuo.html">
            
                    
                    8.4 上传文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.5" data-path="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/85-xia-zai-wen-jian.html">
            
                <a href="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/85-xia-zai-wen-jian.html">
            
                    
                    8.5 下载文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.6" data-path="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/86-wen-jian-jia-shan-chu.html">
            
                <a href="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/86-wen-jian-jia-shan-chu.html">
            
                    
                    8.6 文件夹删除
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.7" data-path="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/87-wen-jian-ming-geng-gai.html">
            
                <a href="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/87-wen-jian-ming-geng-gai.html">
            
                    
                    8.7 文件名更改
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.8" data-path="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/88-wen-jian-xiang-qing-cha-kan.html">
            
                <a href="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/88-wen-jian-xiang-qing-cha-kan.html">
            
                    
                    8.8 文件详情查看
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.9" data-path="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/89-wen-jian-he-wen-jian-jia-pan-duan.html">
            
                <a href="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/89-wen-jian-he-wen-jian-jia-pan-duan.html">
            
                    
                    8.9 文件和文件夹判断
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.10" data-path="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/810-hdfsde-i-o-liu-cao-zuo.html">
            
                <a href="../di-2-bu-fen-hdfs/di-8-zhang-hdfs-ke-hu-duan-cao-zuo/810-hdfsde-i-o-liu-cao-zuo.html">
            
                    
                    8.10 HDFS的I/O流操作
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="../di-2-bu-fen-hdfs/di-9-zhang-hdfs-shu-ju-liang.html">
            
                <a href="../di-2-bu-fen-hdfs/di-9-zhang-hdfs-shu-ju-liang.html">
            
                    
                    第 9 章 HDFS读写数据流
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="../di-2-bu-fen-hdfs/di-9-zhang-hdfs-shu-ju-liang/91-xiang-hdfs-xie-ru-shu-ju-de-liu-cheng.html">
            
                <a href="../di-2-bu-fen-hdfs/di-9-zhang-hdfs-shu-ju-liang/91-xiang-hdfs-xie-ru-shu-ju-de-liu-cheng.html">
            
                    
                    9.1 从HDFS读取数据的流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4.2" data-path="../di-2-bu-fen-hdfs/di-9-zhang-hdfs-shu-ju-liang/92-cong-hdfs-du-qu-shu-ju-de-liu-cheng.html">
            
                <a href="../di-2-bu-fen-hdfs/di-9-zhang-hdfs-shu-ju-liang/92-cong-hdfs-du-qu-shu-ju-de-liu-cheng.html">
            
                    
                    9.2 向HDFS写入数据的流程
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode.html">
            
                <a href="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode.html">
            
                    
                    第 10 章 NameNode和SecondaryNameNode
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.5.1" data-path="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/101-gong-zuo-ji-zhi.html">
            
                <a href="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/101-gong-zuo-ji-zhi.html">
            
                    
                    10.1 NameNode和SecondaryNameNode工作机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5.2" data-path="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/102-namenodede-wen-jian-mu-lu-jie-gou.html">
            
                <a href="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/102-namenodede-wen-jian-mu-lu-jie-gou.html">
            
                    
                    10.2 NameNode的文件目录结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5.3" data-path="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/103-secondarynamenodede-wen-jian-mu-lu-jie-gou.html">
            
                <a href="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/103-secondarynamenodede-wen-jian-mu-lu-jie-gou.html">
            
                    
                    10.3 SecondaryNameNode的文件目录结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5.4" data-path="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/104-namenodegu-zhang-chu-li.html">
            
                <a href="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/104-namenodegu-zhang-chu-li.html">
            
                    
                    10.4 NameNode故障处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5.5" data-path="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/105-ji-qun-an-quan-mo-shi.html">
            
                <a href="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/105-ji-qun-an-quan-mo-shi.html">
            
                    
                    10.5 集群安全模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5.6" data-path="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/106-namenodeduo-mu-lu-pei-zhi.html">
            
                <a href="../di-2-bu-fen-hdfs/di-10-zhang-namenode-he-secondarynamenode/106-namenodeduo-mu-lu-pei-zhi.html">
            
                    
                    10.6 NameNode多目录配置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="../di-2-bu-fen-hdfs/di-11-zhang-datanode.html">
            
                <a href="../di-2-bu-fen-hdfs/di-11-zhang-datanode.html">
            
                    
                    第 11 章 DataNode
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.6.1" data-path="../di-2-bu-fen-hdfs/di-11-zhang-datanode/111-datanodegong-zuo-ji-zhi.html">
            
                <a href="../di-2-bu-fen-hdfs/di-11-zhang-datanode/111-datanodegong-zuo-ji-zhi.html">
            
                    
                    11.1 DataNode工作机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.2" data-path="../di-2-bu-fen-hdfs/di-11-zhang-datanode/112-datanodede-mu-lu-jie-gou.html">
            
                <a href="../di-2-bu-fen-hdfs/di-11-zhang-datanode/112-datanodede-mu-lu-jie-gou.html">
            
                    
                    11.2 DataNode的目录结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.3" data-path="../di-2-bu-fen-hdfs/di-11-zhang-datanode/112-shu-ju-wan-zheng-xing.html">
            
                <a href="../di-2-bu-fen-hdfs/di-11-zhang-datanode/112-shu-ju-wan-zheng-xing.html">
            
                    
                    11.3 数据完整性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.4" data-path="../di-2-bu-fen-hdfs/di-11-zhang-datanode/114-diao-xian-shi-xian-can-shu-she-zhi.html">
            
                <a href="../di-2-bu-fen-hdfs/di-11-zhang-datanode/114-diao-xian-shi-xian-can-shu-she-zhi.html">
            
                    
                    11.4 掉线时限参数设置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.5" data-path="../di-2-bu-fen-hdfs/di-11-zhang-datanode/115-datanodeduo-mu-lu-pei-zhi.html">
            
                <a href="../di-2-bu-fen-hdfs/di-11-zhang-datanode/115-datanodeduo-mu-lu-pei-zhi.html">
            
                    
                    11.5 DataNode多目录配置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">第 3 部分 MapReduce</li>
        
        
    

    
        
        <li class="header">第 4 部分 Hadoop高级特性</li>
        
        
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >5.2 伪分布运行模式</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="52-&#x4F2A;&#x5206;&#x5E03;&#x8FD0;&#x884C;&#x6A21;&#x5F0F;">5.2 &#x4F2A;&#x5206;&#x5E03;&#x8FD0;&#x884C;&#x6A21;&#x5F0F;</h1>
<p><code>Hadoop</code>&#x4E5F;&#x53EF;&#x4EE5;&#x4EE5;&#x4F2A;&#x5206;&#x5E03;&#x6A21;&#x5F0F;&#x7684;&#x65B9;&#x5F0F;&#x8FD0;&#x884C;&#x5728;&#x5355;&#x8282;&#x70B9;&#x4E0A;, &#x8FD9;&#x4E2A;&#x65F6;&#x5019;&#x6BCF;&#x4E00;&#x4E2A;<code>Hadoop</code>&#x5B88;&#x62A4;&#x8FDB;&#x7A0B;&#x90FD;&#x662F;&#x4E00;&#x4E2A;&#x5355;&#x72EC;&#x7684;<code>Java</code>&#x8FDB;&#x7A0B;.</p>
<p>&#x8FD9;&#x79CD;&#x6A21;&#x5F0F;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x76F8;&#x5E94;&#x7684;&#x5206;&#x5E03;&#x5F0F;&#x8BBE;&#x7F6E;, &#x4F46;&#x662F;&#x53C8;&#x7531;&#x4E8E;&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x8282;&#x70B9;, &#x6240;&#x4EE5;&#x6211;&#x4EEC;&#x79F0;&#x4E4B;&#x4E3A;<strong>&#x4F2A;&#x5206;&#x5E03;&#x6A21;&#x5F0F;</strong>.</p>
<p>&#x7531;&#x4E8E;<code>Hadoop2.x</code>&#x589E;&#x52A0;&#x4E86;<code>Yarn</code>, &#x6240;&#x4EE5;&#x6709;&#x4E24;&#x4E2A;&#x9009;&#x62E9;: &#x53EF;&#x4EE5;&#x628A;<code>MapReduce</code>&#x7A0B;&#x5E8F;&#x76F4;&#x63A5;&#x8FD0;&#x884C;&#x5728;<code>HDFS</code>&#x4E0A;, &#x4E5F;&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x8FD0;&#x884C;&#x5728;<code>Yarn</code>&#x4E0A;</p>
<hr>
<h2 id="521-&#x5728;hdfs&#x4E0A;&#x8FD0;&#x884C;mapreduce&#x7A0B;&#x5E8F;">5.2.1 &#x5728;<code>HDFS</code>&#x4E0A;&#x8FD0;&#x884C;<code>MapReduce</code>&#x7A0B;&#x5E8F;</h2>
<h3 id="&#x914D;&#x7F6E;&#x96C6;&#x7FA4;">&#x914D;&#x7F6E;&#x96C6;&#x7FA4;</h3>
<ol>
<li><p>&#x5728;<code>etc/hadoop/hadoop-env.sh</code>&#x4E2D;&#x914D;&#x7F6E;<code>JAVA_HOME</code>&#x53D8;&#x91CF;</p>
<ul>
<li><p>&#x83B7;&#x53D6;<code>jdk</code>&#x5B89;&#x88C5;&#x8DEF;&#x5F84;: <code>echo $JAVA_HOME</code></p>
</li>
<li><p>&#x5728;<code>etc/hadoop/hadoop-env.sh</code>&#x4E2D;&#x6DFB;&#x52A0;&#x4E00;&#x884C;&#x4EE3;&#x7801;:</p>
<pre class="language-"><code>export JAVA_HOME=/opt/module/jdk1.8.0_172
</code></pre></li>
</ul>
<blockquote>
<h4 id="&#x6CE8;&#x610F;"><em>&#x6CE8;&#x610F;:</em></h4>
</blockquote>
<ul>
<li>&#x662F;<code>Hadoop</code>&#x4E0B;&#x7684;<code>etc</code>&#x76EE;&#x5F55;, &#x4E0D;&#x662F;&#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x7684;<code>etc</code>&#x76EE;&#x5F55;</li>
</ul>
</li>
<li><p>&#x914D;&#x7F6E;<code>core-site.xml</code> (&#x6838;&#x5FC3;&#x7AD9;&#x70B9;)</p>
<pre class="language-"><code class="lang-xml"><span class="token comment" spellcheck="true">&lt;!-- &#x6307;&#x5B9A;HDFS&#x4E2D;NameNode&#x7684;&#x5730;&#x5740; --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>name</span><span class="token punctuation">&gt;</span></span>fs.defaultFS<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>name</span><span class="token punctuation">&gt;</span></span>
  <span class="token comment" spellcheck="true">&lt;!-- &#x5730;&#x5740;&#x8981;&#x6839;&#x636E;&#x81EA;&#x5DF1;&#x5B9E;&#x9645;&#x60C5;&#x51B5;&#x6765;&#x5199;. &#x5177;&#x4F53;&#x7684;ip&#x5730;&#x5740;&#x4E5F;&#x662F;&#x53EF;&#x4EE5;&#x7684; --&gt;</span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>value</span><span class="token punctuation">&gt;</span></span>hdfs://hadoop201:9000<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>value</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>property</span><span class="token punctuation">&gt;</span></span>
<span class="token comment" spellcheck="true">&lt;!-- &#x6307;&#x5B9A;hadoop&#x8FD0;&#x884C;&#x65F6;&#x4EA7;&#x751F;&#x6587;&#x4EF6;&#x7684;&#x5B58;&#x50A8;&#x76EE;&#x5F55; --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>name</span><span class="token punctuation">&gt;</span></span>hadoop.tmp.dir<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>name</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>value</span><span class="token punctuation">&gt;</span></span>/opt/module/hadoop-2.7.2/data/tmp<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>value</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>property</span><span class="token punctuation">&gt;</span></span>
</code></pre>
</li>
<li><p>&#x914D;&#x7F6E;<code>hdfs-site.xml</code>(<code>hdfs</code>&#x7AD9;&#x70B9;)</p>
<pre class="language-"><code class="lang-xml"><span class="token comment" spellcheck="true">&lt;!-- &#x6307;&#x5B9A;HDFS&#x526F;&#x672C;&#x7684;&#x6570;&#x91CF; --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>name</span><span class="token punctuation">&gt;</span></span>dfs.replication<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>name</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>value</span><span class="token punctuation">&gt;</span></span>1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>value</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>property</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<blockquote>
<h4 id="&#x8BF4;&#x660E;"><em>&#x8BF4;&#x660E;:</em></h4>
</blockquote>
<ul>
<li><p>&#x8FD9;&#x91CC;&#x8BBE;&#x7F6E;&#x7684;&#x526F;&#x672C;&#x7684;&#x6570;&#x91CF;&#x662F;&#x6307;&#x7684;&#x5C06;&#x6765;&#x5728;<code>HDFS</code>&#x4E0A;&#x5B58;&#x50A8;&#x7684;&#x6587;&#x4EF6;&#x7684;&#x526F;&#x672C;. </p>
</li>
<li><p>&#x56E0;&#x4E3A;&#x73B0;&#x5728;&#x914D;&#x7F6E;&#x7684;&#x662F;&#x5355;&#x8282;&#x70B9;&#x4F2A;&#x5206;&#x5E03;&#x6A21;&#x5F0F;, &#x6240;&#x4EE5;&#x628A;&#x526F;&#x672C;&#x6570;&#x91CF;&#x8BBE;&#x7F6E;&#x4E3A; <code>1</code></p>
</li>
</ul>
</li>
</ol>
<hr>
<h3 id="&#x542F;&#x52A8;&#x96C6;&#x7FA4;">&#x542F;&#x52A8;&#x96C6;&#x7FA4;</h3>
<ol>
<li><p>&#x683C;&#x5F0F;&#x5316; <code>NameNode</code>.</p>
<pre class="language-"><code>hdfs namenode -format
</code></pre><blockquote>
<h4 id="&#x6CE8;&#x610F;"><em>&#x6CE8;&#x610F;:</em></h4>
</blockquote>
<ul>
<li><p>&#x683C;&#x5F0F;&#x5316;&#x7684;&#x52A8;&#x4F5C;&#x53EA;&#x9700;&#x8981;&#x6267;&#x884C;&#x4E00;&#x6B21;&#x5373;&#x53EF;. &#x4EE5;&#x540E;&#x518D;&#x542F;&#x52A8;&#x96C6;&#x7FA4;&#x4E0D;&#x9700;&#x8981;&#x91CD;&#x590D;&#x6267;&#x884C;&#x8FD9;&#x4E2A;&#x52A8;&#x4F5C;.</p>
</li>
<li><p>&#x591A;&#x6B21;&#x683C;&#x5F0F;&#x5316;&#x4F1A;&#x51FA;&#x73B0;&#x5F02;&#x5E38;, &#x52A1;&#x5FC5;&#x4E0D;&#x8981;&#x591A;&#x6B21;&#x683C;&#x5F0F;&#x5316;.</p>
</li>
</ul>
</li>
<li><p>&#x542F;&#x52A8; <code>namenode</code></p>
<pre class="language-"><code>hadoop-daemon.sh start namenode
</code></pre></li>
<li><p>&#x542F;&#x52A8; <code>datanode</code> </p>
<pre class="language-"><code>hadoop-daemon.sh start datanode
</code></pre></li>
</ol>
<hr>
<h3 id="&#x67E5;&#x770B;&#x96C6;&#x7FA4;">&#x67E5;&#x770B;&#x96C6;&#x7FA4;</h3>
<ol>
<li><p>&#x67E5;&#x770B;<code>namenode</code>&#x548C;<code>datanode</code>&#x662F;&#x5426;&#x542F;&#x52A8;&#x6210;&#x529F;</p>
<pre class="language-"><code>jps
</code></pre><p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531012963984.png"></p>
</li>
<li><p>&#x65E5;&#x5FD7;&#x6587;&#x4EF6;&#x5728;<code>logs</code>&#x76EE;&#x5F55;&#x4E0B;.&#x5982;&#x679C;&#x542F;&#x52A8;&#x5931;&#x8D25;&#x53EF;&#x4EE5;&#x5728;&#x65E5;&#x5FD7;&#x6587;&#x4EF6;&#x4E2D;&#x67E5;&#x627E;&#x5931;&#x8D25;&#x7684;&#x539F;&#x56E0;.</p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531013054477.png"></p>
</li>
<li><p>&#x4F7F;&#x7528;<code>web</code>&#x7AEF;&#x67E5;&#x770B;<code>hdfs</code>&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;</p>
<p>web&#x7AEF;&#x5730;&#x5740;&#x662F;:
<a href="http://192.168.1.201:50070/" target="_blank">http://192.168.1.201:50070/</a></p>
<blockquote>
<h4 id="&#x6CE8;&#x610F;"><em>&#x6CE8;&#x610F;:</em></h4>
</blockquote>
<ul>
<li><p>&#x5730;&#x5740;&#x5176;&#x5B9E;&#x5C31;&#x662F;<code>namenode</code>&#x6240;&#x5728;&#x7684;&#x4E3B;&#x673A;&#x7684;&#x5730;&#x5740;</p>
</li>
<li><p><code>50070</code> &#x662F;<code>web</code>&#x7AEF;&#x53E3;. &#x548C;&#x524D;&#x9762;&#x914D;&#x7F6E;&#x7684;<code>9000</code>&#x533A;&#x522B;&#x5F00;&#x6765;: <code>9000</code>&#x662F;<code>datanode</code>&#x4E0E;<code>namenode</code>&#x901A;&#x8BAF;&#x65F6;&#x7684;&#x7AEF;&#x53E3;.</p>
</li>
</ul>
</li>
</ol>
<hr>
<h3 id="&#x64CD;&#x4F5C;&#x96C6;&#x7FA4;&#x5728;&#x96C6;&#x7FA4;&#x4E0A;&#x8FD0;&#x884C;wordcount&#x7A0B;&#x5E8F;">&#x64CD;&#x4F5C;&#x96C6;&#x7FA4;:&#x5728;&#x96C6;&#x7FA4;&#x4E0A;&#x8FD0;&#x884C;<code>wordcount</code>&#x7A0B;&#x5E8F;</h3>
<ol>
<li><p>&#x5728;&#x672C;&#x5730;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;<code>words.txt</code>, &#x6587;&#x4EF6;&#x5185;&#x5BB9;&#x5982;&#x4E0B;:(&#x5185;&#x5BB9;&#x968F;&#x610F;)</p>
<pre class="language-"><code>hello world hello world
atguigu
hello 
I love atguigu
hello world
how are you
</code></pre></li>
<li><p>&#x5728;<code>hdfs</code>&#x7CFB;&#x7EDF;&#x7684;&#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x5939;<code>/input</code>.</p>
<pre class="language-"><code>hdfs dfs -mkdir /input
</code></pre></li>
<li><p>&#x628A;<code>words.txt</code>&#x4E0A;&#x4F20;&#x5230;<code>hdfs</code>&#x7CFB;&#x7EDF;&#x4E0A;&#x7684;<code>/input</code>&#x76EE;&#x5F55;&#x4E0B;</p>
<pre class="language-"><code>hdfs dfs -put words.txt /input
</code></pre></li>
<li><p>&#x67E5;&#x770B;&#x662F;&#x5426;&#x4E0A;&#x4F20;&#x6210;&#x529F;</p>
<ul>
<li><p>&#x65B9;&#x6CD5;1: <code>hdfs dfs -ls /input</code>
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531014715563.png"></p>
</li>
<li><p>&#x65B9;&#x6CD5;2: &#x4F7F;&#x7528;<code>web</code>&#x7AEF;&#x67E5;&#x770B;: <code>http://hadoop201:50070</code>
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531014982674.png">
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531015121747.png">
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531015025661.png"></p>
</li>
</ul>
</li>
<li><p>&#x5728;&#x96C6;&#x7FA4;&#x4E0A;&#x8FD0;&#x884C;<code>wordcount</code>&#x7A0B;&#x5E8F;</p>
<pre class="language-"><code>hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar wordcount /input /output
</code></pre><p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531015551412.png"></p>
</li>
<li><p>&#x67E5;&#x770B;&#x8F93;&#x51FA;&#x7ED3;&#x679C;</p>
<ul>
<li><p>&#x65B9;&#x6CD5;1: &#x76F4;&#x63A5;&#x5728;<code>hdfs</code>&#x7CFB;&#x7EDF;&#x4E0A;&#x67E5;&#x770B;</p>
<pre class="language-"><code>hdfs dfs -cat /output/part-r-00000
</code></pre><p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531015785173.png"></p>
</li>
<li><p>&#x65B9;&#x6CD5;2: &#x628A;&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x4E0B;&#x8F7D;&#x5230;&#x672C;&#x5730;&#x4E4B;&#x540E;&#x67E5;&#x770B;</p>
<pre class="language-"><code>hdfs dfs -get /output ./
</code></pre><p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531015974901.png"></p>
</li>
</ul>
</li>
</ol>
<hr>
<h2 id="521-&#x5728;yarn&#x4E0A;&#x8FD0;&#x884C;mapreduce&#x7A0B;&#x5E8F;">5.2.1 &#x5728;<code>Yarn</code>&#x4E0A;&#x8FD0;&#x884C;<code>MapReduce</code>&#x7A0B;&#x5E8F;</h2>
<p><code>Hadoop2.x</code>&#x589E;&#x52A0;&#x4E86;&#x7EC4;&#x4EF6;<code>Yarn</code>, &#x6211;&#x4EEC;&#x4E5F;&#x53EF;&#x4EE5;&#x628A;&#x6211;&#x4EEC;&#x7684;<code>MapReduce</code>&#x7A0B;&#x5E8F;&#x5728;<code>Yarn</code>&#x4E0A;&#x6267;&#x884C;.</p>
<p>&#x800C;&#x4E14;, &#x4EE5;&#x540E;&#x4E5F;&#x786E;&#x5B9E;&#x5E94;&#x8BE5;&#x8FD9;&#x4E48;&#x505A;.  </p>
<p>&#x5173;&#x4E8E;<code>Yarn</code>&#x5177;&#x4F53;&#x4F5C;&#x7528;&#x6211;&#x4EEC;&#x5728;&#x540E;&#x9762;&#x7684;&#x8BFE;&#x7A0B;&#x4E2D;&#x4F1A;&#x8BE6;&#x7EC6;&#x8BB2;&#x89E3;.</p>
<p>&#x5728;&#x524D;&#x9762;&#x914D;&#x7F6E;&#x7684;&#x57FA;&#x7840;&#x4E0A;, &#x914D;&#x7F6E;<code>Yarn</code>&#x5C31;&#x53EF;&#x4EE5;&#x4E86;.</p>
<h3 id="&#x96C6;&#x7FA4;&#x914D;&#x7F6E;">&#x96C6;&#x7FA4;&#x914D;&#x7F6E;</h3>
<ol>
<li><p>&#x5728;<code>etc/haddop/yarn-env.sh</code>&#x4E0A;&#x914D;&#x7F6E;<code>JAVA_HOME</code> (&#x4F2A;&#x5206;&#x5E03;&#x6A21;&#x5F0F;&#x4E2D;&#x4E0D;&#x914D;&#x7F6E;&#x4E5F;&#x53EF;, &#x4F46;&#x662F;&#x5728;&#x5168;&#x5206;&#x5E03;&#x6A21;&#x5F0F;&#x4E2D;&#x5C31;&#x5FC5;&#x987B;&#x8981;&#x914D;&#x7F6E;&#x4E86;)</p>
<pre class="language-"><code>export JAVA_HOME=/opt/module/jdk1.8.0_172
</code></pre></li>
<li><p>&#x914D;&#x7F6E;<code>yarn-site.xml</code></p>
<pre class="language-"><code class="lang-xml"><span class="token comment" spellcheck="true">&lt;!-- reducer&#x83B7;&#x53D6;&#x6570;&#x636E;&#x7684;&#x65B9;&#x5F0F; --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>name</span><span class="token punctuation">&gt;</span></span>yarn.nodemanager.aux-services<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>name</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>value</span><span class="token punctuation">&gt;</span></span>mapreduce_shuffle<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>value</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>property</span><span class="token punctuation">&gt;</span></span>

<span class="token comment" spellcheck="true">&lt;!-- &#x6307;&#x5B9A;YARN&#x7684;ResourceManager&#x7684;&#x5730;&#x5740; --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>name</span><span class="token punctuation">&gt;</span></span>yarn.resourcemanager.hostname<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>name</span><span class="token punctuation">&gt;</span></span>
  <span class="token comment" spellcheck="true">&lt;!-- &#x4E3B;&#x673A;&#x5730;&#x5740;&#x8981;&#x6839;&#x636E;&#x5B9E;&#x9645;&#x60C5;&#x51B5;&#x6765;&#x5B9A; --&gt;</span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>value</span><span class="token punctuation">&gt;</span></span>hadoop201<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>value</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>property</span><span class="token punctuation">&gt;</span></span>
</code></pre>
</li>
<li><p>&#x914D;&#x7F6E;<code>/etc/hadoop/mapred-site.xml</code></p>
<ul>
<li>&#x590D;&#x5236;&#x51FA;&#x6765;&#x4E00;&#x4E2A;<code>/etc/hadoop/mapred-site.xml</code><pre class="language-"><code>cp mapred-site.xml.template mapred-site.xml
</code></pre></li>
<li><p>&#x914D;&#x7F6E;<code>/etc/hadoop/mapred-site.xml</code></p>
<pre class="language-"><code class="lang-xml"><span class="token comment" spellcheck="true">&lt;!-- &#x6307;&#x5B9A;MapReduce&#x7A0B;&#x5E8F;&#x8FD0;&#x884C;&#x5728;yarn&#x4E0A; --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span><span class="token punctuation">&gt;</span></span>
   <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>name</span><span class="token punctuation">&gt;</span></span>mapreduce.framework.name<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>name</span><span class="token punctuation">&gt;</span></span>
   <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>value</span><span class="token punctuation">&gt;</span></span>yarn<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>value</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>property</span><span class="token punctuation">&gt;</span></span>
</code></pre>
</li>
</ul>
</li>
<li><p>&#x542F;&#x52A8;<code>resourcemanager</code></p>
<pre class="language-"><code>yarn-daemon.sh start resourcemanager
</code></pre><p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531018339731.png"></p>
</li>
<li><p>&#x542F;&#x52A8;<code>nodemanager</code></p>
<pre class="language-"><code>yarn-daemon.sh start nodemanager
</code></pre><p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531018456074.png"></p>
</li>
</ol>
<h3 id="&#x96C6;&#x7FA4;&#x64CD;&#x4F5C;">&#x96C6;&#x7FA4;&#x64CD;&#x4F5C;</h3>
<ol>
<li><p>&#x67E5;&#x770B;<code>Yarn</code>: <a href="http://192.168.1.201:8088/cluster" target="_blank">http://192.168.1.201:8088/cluster</a></p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531018669496.png"></p>
</li>
<li><p>&#x8FD0;&#x884C;<code>MapReduce</code>&#x7A0B;&#x5E8F;:<code>wordcount</code></p>
<pre class="language-"><code>hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar wordcount /input /output2
</code></pre></li>
<li><p>&#x67E5;&#x770B;&#x6267;&#x884C;&#x7ED3;&#x679C;</p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/markdown/1531019046506.png"></p>
</li>
</ol>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x5C1A;&#x7845;&#x8C37;&#x5927;&#x6570;&#x636E; 2013-2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification"><br>&#x8BE5;&#x6587;&#x4EF6;&#x6700;&#x540E;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2018-11-20 18:14:11
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="51-ben-di-yun-xing-mo-shi.html" class="navigation navigation-prev " aria-label="Previous page: 5.1 本地运行模式">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="53-wan-quan-fen-bu-yun-xing-mo-shi.html" class="navigation navigation-next " aria-label="Next page: 5.3 完全分布运行模式">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"5.2 伪分布运行模式","level":"1.6.2","depth":2,"next":{"title":"5.3 完全分布运行模式","level":"1.6.3","depth":2,"path":"di-4-zhang-yun-xing-hadoop/53-wan-quan-fen-bu-yun-xing-mo-shi.md","ref":"di-4-zhang-yun-xing-hadoop/53-wan-quan-fen-bu-yun-xing-mo-shi.md","articles":[]},"previous":{"title":"5.1 本地运行模式","level":"1.6.1","depth":2,"path":"di-4-zhang-yun-xing-hadoop/51-ben-di-yun-xing-mo-shi.md","ref":"di-4-zhang-yun-xing-hadoop/51-ben-di-yun-xing-mo-shi.md","articles":[]},"dir":"ltr"},"config":{"plugins":["splitter","expandable-chapters-small","page-toc-button","-highlight","prism","prism-themes","tbfed-pagefooter","sitemap","change_girls","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 尚硅谷大数据 2013-2019","modify_label":"<br>该文件最后修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"disqus":{"shortName":"zhenchao125"},"livereload":{},"splitter":{},"change_girls":{"time":30,"urls":["http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/62171757.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/83394736.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3394270.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/65028582.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/20359261.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/37472401.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3355397.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/11075549.jpg-atguiguImg"]},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"sitemap":{"hostname":"https://www.gitbook.com/@zhenchao125"},"page-toc-button":{"maxTocDepth":3,"minTocSize":2},"prism-themes":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":" 李振超","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"大数据hadoop课堂笔记","language":"zh-hans","links":{"sidebar":{"联系我们":"http://www.atguigu.com/"}},"gitbook":"*","description":"课堂笔记,学生提前预习"},"file":{"path":"di-4-zhang-yun-xing-hadoop/52-wei-fen-bu-yun-xing-mo-shi.md","mtime":"2018-11-20T10:14:11.775Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-12-28T00:23:48.052Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-change_girls/girls.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

